package com.stylefeng.guns.core.page;

/**
 * 分页参数类（for BootStrap Table）
 *
 * @author fengshuonan
 * @date 2017年1月21日 下午2:21:35
 */
public class PageBT {

    // 每页显示个数(默认值为10)
    private Integer limit = 20;

    // 查询的偏移量（查询的页数 = offset/limit + 1）
    private Integer offset = 0;

    // 排序方式
    private String order = "desc";

    //搜索关键字
    private String condition;

    private String beginTime;

    private String endTime;


    public PageBT() {
        super();
    }

    public String getEndTime() {
        return endTime;
    }

    public void setEndTime(String endTime) {
        this.endTime = endTime;
    }

    public String getBeginTime() {
        return beginTime;
    }

    public void setBeginTime(String beginTime) {
        this.beginTime = beginTime;
    }

    public String getCondition() {
        return condition;
    }

    public void setCondition(String condition) {
        this.condition = condition;
    }

    public PageBT(Integer limit, Integer offset) {
        super();
        this.limit = limit;
        this.offset = offset;
    }

    public Integer getLimit() {
        return limit;
    }

    public void setLimit(Integer limit) {
        this.limit = limit;
    }

    public Integer getOffset() {
        return offset;
    }

    public void setOffset(Integer offset) {
        this.offset = offset;
    }

    public String getOrder() {
        return order;
    }

    public void setOrder(String order) {
        this.order = order;
    }

    public Integer getPageSize() {
        return this.limit;
    }

    public Integer getPageNumber() {
        return this.offset / this.limit + 1;
    }

    @Override
    public String toString() {
        return "PageBT [limit=" + limit + ", offset=" + offset + ", order=" + order + "]";
    }

}
